create or replace view vac_app_lists_4_1 as
with ls as
(
 select
  workspace,
  workspace_display_name,
  application_id,
  application_name,
  list_name,
  list_type,
  list_type_code,
  list_query,
  template,
  build_option,
  to_char(list_entries) list_entries,
  last_updated_by,
  last_updated_on,
  component_comment,
  list_id,
  component_signature
 from apex_application_lists t
)
select
  workspace,
  workspace_display_name,
  application_id,
  application_name,
  list_name,
  last_updated_by,
  last_updated_on,
  list_id,
  component_signature,
  u_name,
  u_value,
  'APEX_APPLICATION_LISTS' src_view_name
from ls
 UNPIVOT INCLUDE NULLS ( u_value
   FOR    u_name
   IN
   (
      list_type,
      list_type_code,
      list_query,
      template,
      build_option,
      list_entries,
      component_comment
   )
 );

